package cn.edu.sjtu.se.dslab.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import cn.edu.sjtu.se.dslab.dao.IBaseDao;
import cn.edu.sjtu.se.dslab.dao.IPositionDao;
import cn.edu.sjtu.se.dslab.project.Position;


@Repository("positionDao")
public class PositionDaoImpl implements IPositionDao {
	
	@Resource(name = "baseDao")
	private IBaseDao<Position> baseDao;
	
	@Override
	public Position queryById(long id) {
		return baseDao.queryById(Position.class, id);
	}

	@Override
	public void save(Position position) {
		baseDao.save(position);
	}

	@Override
	public Position update(Position position) {
		return baseDao.update(position);
	}

	@Override
	public List<Position> queryByList() {
		//the name of the class, the first letter must be uppercase
		return baseDao.queryList("Position");
	}
	
}
